<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <title>商户审核</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon"/>
    <!-- 当前页面样式 -->
    <link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
    <!-- 当前页面样式 END -->
    <script type="text/javascript" src="<c:url value="/js/jquery-1.3.2.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
	<script type='text/javascript' src='<s:url value="/js/pageAjax.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/dwr/engine.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/dwr/interface/MccQuery.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/js/querySon.js"/>'></script>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#assign').click(function(){
			var dd = $("input[name=multi_sel]:checked");
			if(dd.length != 1){
				alert("请选择一条记录");
				return false;
			}
			var idd = dd.val();							
			if(dd.length == 0){
				alert("请选择记录");
				return false;
			}else{
				$("#assign").attr("disabled",true);
				window.location.href='<%=basePath%>/formalMerinfo/merInfoAssginInit.ct?merinfo.id='+idd;
			}
		});
	});
	
	function queryForm(obj){
		$("#"+obj.id).attr("disabled",true);
		$("#queryUserForm").attr("action",'<s:url value="/formalMerinfo/queryList.ct"/>');
		$("#queryUserForm").submit();		
	}
	function isDetail(str){
		$("#queryUserForm").attr("action","<%=basePath%>/formalMerinfo/queryMerchtDetail.ct?merinfo.id="+str);
		$("#queryUserForm").submit();
	}	
	$(document).ready(function(){
		var uId=$("#userId").val();
	 	loadProvince(uId);
	 	 //冻结
	 	 $("#freezeMerinfoBtnNew").click(function(){
		    	var mid=checkChooseNum();
		    	if(!mid){
		    		return;
		    	}
		    	$("#queryUserForm").attr("action","<%=basePath%>/formalMerinfo/freezePage.ct?merinfo.id="+mid+"&merinfo.status=03");
				$("#queryUserForm").submit();
		    }); 
	 	 //解冻
	 	 $("#resetFreezeMerinfoBtnNew").click(function(){
		    	var mid=checkChooseNum();
		    	if(!mid){
		    		return;
		    	}
		    	$("#queryUserForm").attr("action","<%=basePath%>/formalMerinfo/freezePage.ct?merinfo.id="+mid+"&merinfo.status=01");
				$("#queryUserForm").submit();
		    });
	 	 //注销
	 	 $("#logoutMerinfoBtnNew").click(function(){
		    	var mid=checkChooseNum();
		    	if(!mid){
		    		return;
		    	}
		    	$("#queryUserForm").attr("action","<%=basePath%>/formalMerinfo/freezePage.ct?merinfo.id="+mid+"&merinfo.status=02");
				$("#queryUserForm").submit();
		    });
	 	 //导出
	 	$("#szPower").click(function() {
				$("#queryUserForm").attr("action","<%=basePath%>/formalMerinfo/exportmerinfoExcel.ct");
				$("#queryUserForm").submit();
	      });
	});
	
</script>
</head>
<body>
<s:form id="queryUserForm" action="/formalMerinfo/queryList.ct" method="post" theme="simple">
<s:hidden id="userId" value="%{#session.session_merchant.id}"/>
<table class="tb">
    <tbody>
        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
        </tr>

        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h3">商户查询</div></td>
        </tr>
 
       <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">商户号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.merchantNo" />
               	</label>
            </td>
             <td align="right" class="tb-td">
                <div class="tb-h4">商户简称：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.merchantName" maxlength="20"/>
                </label>
            </td>
        </tr>

        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">营业名称：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.merBrName" maxlength="25"/>
                </label>
            </td>
            <td align="right" class="tb-td">入网时间：</td>
			<td class="tb-td" >
				 <label class="tb-input-normal">
					<s:textfield    onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,wdate:true,errDealMode:0});"    name="searchCondition.minDate"  />
				 </label>
				-
				 <label class="tb-input-normal">
					<s:textfield  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,wdate:true,errDealMode:0});"   name="searchCondition.maxDate"   />
				</label>
			</td>
        </tr>
		<tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">法人名称：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.certifName" maxlength="25"/>
               	</label>
            </td>
             <td align="right" class="tb-td">
                <div class="tb-h4">法人身份证：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.cardNo" maxlength="20"/>
                </label>
            </td>
        </tr>
        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">业务联系人名称：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.contactName" maxlength="25"/>
               	</label>
            </td>
             <td align="right" class="tb-td">
                <div class="tb-h4">业务联系人手机号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.phone" maxlength="15" />
                </label>
            </td>
        </tr>
        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">结算账号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.accountNo" maxlength="25"/>
               	</label>
            </td>
             <td align="right" class="tb-td">
                <div class="tb-h4">结算账户姓名：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.accountName" maxlength="20" />
                </label>
            </td>
        </tr>
        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">非法人身份证：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.clearCardId" maxlength="25"/>
               	</label>
            </td>
             <td align="right" class="tb-td">
                <div class="tb-h4">商户直属代理商：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.directlyAgent" maxlength="20" />
                </label>
            </td>
        </tr>
		<tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">商户状态：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-mini">
                	<s:select list="#{'99':'请选择状态','01':'正常','03':'冻结','02':'注销' }" name="searchCondition.status" />
               	</label>
            </td>
            <td align="right" class="tb-td">
                <div class="tb-h4">商户连接方式：</div>
            </td>
           <td class="tb-td" >
		       <s:select  name="searchCondition.association" list="#{'1':'直联','0':'间联','2':'间连直营'}"  headerKey="99" headerValue="--请选择--" cssClass="queryWidth" /> 
      	   </td>
          </tr>
		<tr class="tb-line">
			<td align="right" class="tb-td">
				<div class="tb-h4">营业执照号：</div>
			</td>	
			<td class="tb-td">
				<label class="tb-input-normal">
					<s:textfield  name="searchCondition.busiLiceNo" maxlength="20" />
				</label>
			</td>
			<s:if test="#session.session_merchant.roleType!=\"00\" && #session.session_merchant.roleType!=\"12\" && #session.session_merchant.roleType!=\"13\"">
			<td align="right" class="tb-td">
				<div class="tb-h4">代理商：</div>
			</td>
			<td class="tb-td">
				<select id="parentCode" name="searchCondition.parentCode" onchange="loadCity()"></select>-
				<s:hidden id="henParentCode" value="%{searchCondition.parentCode}"/>
				<select id="sonCode" name="searchCondition.sonCode"></select>
				<s:hidden id="henSonCode" value="%{searchCondition.sonCode}"/>
			</td>
			</s:if>
		</tr>
        <tr class="tb-line">
            <td class="tb-td line-submit" align="right" colspan="4">
                <label class="tb-input-submit">
                    <input type="button" value="查询" id="queryBtn" onclick="queryForm(this)"/>
                </label>
                <label class="tb-input-submit">
                    <input type="reset" value="取消"/>
                </label>
                <%-- <label class="tb-input-submit">
                	<s:if  test="#request.searchRsList != null && #request.searchRsList.size>0">
						<input id="szPower" type="button" value="导出Excel" />
					</s:if>
					<s:else>
					 	<input id="szPower" disabled="disabled" value="导出Excel" type="button" />
					</s:else>
                </label> --%>
                <%-- <s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
                <label class="tb-input-submit">
                    <input id="assign" type="button" value="商户分配"/>
                </label>
                </s:if>
                <s:else>
                	<label class="tb-input-submit">
                    <input id="assign" type="button" value="商户分配" disabled="disabled"/>
                	</label>
                </s:else> --%>
                <s:if test="op.roleType==\"12\" || op.roleType==\"13\"">
                	<label class="tb-input-submit">
                    	<input id="freezeMerinfoBtnNew" name="merinfoListBtn" type="button" value="冻结"/>
               		</label>
                	
                	<label class="tb-input-submit">
                    	<input id="resetFreezeMerinfoBtnNew" name="merinfoListBtn" type="button" value="解冻"/>
               		</label>
               		
               		<label class="tb-input-submit">
                    	<input id="logoutMerinfoBtnNew" name="merinfoListBtn" type="button"  value="注销"/>
               		</label>
                
                	<!-- <label class="tb-input-submit">
                    	<input id="freezeMerinfoBtn" name="merinfoListBtn" type="button" value="冻结"/>
               		</label>
               		<label class="tb-input-submit">
                    	<input id="resetFreezeMerinfoBtn" name="merinfoListBtn" type="button" value="解冻"/>
               		</label>
               		<label class="tb-input-submit">
                    	<input id="logoutMerinfoBtn" name="merinfoListBtn" type="button"  value="注销"/>
               		</label> -->
                </s:if>
            </td>
        </tr>
         <tr class="tb-line">
         		<td class="tb-td line-submit" align="center" colspan="4">
         			<font color="red" id="msgInfo"><s:actionmessage/>
         				<s:if test="#request.COUNT != null">
		               	统计：当前查询条件共计[<font color="red"><s:property value="#request.COUNT"/></font>]条数据
		               	</s:if>
         			</font>
         		</td>
         </tr>
        <s:if test="#request.searchRsList != null && #request.searchRsList.size>0 ">
			<tr class="tb-line">
				<td class="tb-td paging"  align="left" colspan="4"> 
					 	<page:pageCount max_pages="11" totalPage="${requestScope.totalPage}"
						currentPage="${requestScope.currentPage}"
						action="${rootPath}/formalMerinfo/queryList.ct?currentPage=" />

				</td>
			</tr>
		</s:if>
    </tbody>
</table>
</s:form>
<div class="big-tb">
    <table class="tb" style="width: 150%;">
        <thead>
            <tr class="tb-line">
                <s:if test="op.roleType==\"18\"||op.roleType==\"00\"||op.roleType==\"12\"||op.roleType==\"13\"||op.groupCd==\"2\" ">
				 <th class="tb-th" colspan="26">商户基本信息列表</th>
				</s:if>
				<s:else>
				 <th class="tb-th" colspan="22">商户基本信息列表</th>
				</s:else>
               
            </tr>
            <tr class="tb-line bg-gray">
            	<s:if test="op.roleType==\"12\" || op.roleType==\"13\" ">
            		<th class="tb-th">选择</th>
            	</s:if>
				<th class="tb-th">商户号</th>
				<th class="tb-th">商户简称</th>
				<th class="tb-th">营业名称</th>
				<th class="tb-th">结算方式</th>
				<th class="tb-th">商户类别</th>
				<th class="tb-th">所属机构</th>
				<th class="tb-th">所属分公司</th>
				<!-- <th class="tb-th">所属代理商</th> -->
				<th class="tb-th">直属代理商</th>
				<th class="tb-th">审核人员</th>
				<th class="tb-th">审核日期</th>
				<th class="tb-th">状态</th>
				<th class="tb-th">业务联系人</th>
				<th class="tb-th">业务联系人电话</th>
				<th class="tb-th">法人</th>
				<th class="tb-th">法人证件号</th>
				<s:if test="op.roleType==\"18\"||op.roleType==\"00\"||op.roleType==\"12\"||op.roleType==\"13\"||op.groupCd==\"2\" ">
				 <th class="tb-th">身份证号有效期</th>
				</s:if>
				<th class="tb-th">结算银行</th>
				<th class="tb-th">联行号</th>
				<th class="tb-th">结算银行账号名称</th>
				<th class="tb-th">结算银行账号</th>
				<th class="tb-th">商户地址</th>
				<th class="tb-th">营业执照号</th>
				<s:if test="op.roleType==\"18\"||op.roleType==\"00\"||op.roleType==\"12\"||op.roleType==\"13\"||op.groupCd==\"2\" ">
				<th class="tb-th">营业执照有效期</th>
				<th class="tb-th">机具产权</th>
				<th class="tb-th">发展人</th>
				</s:if>
            </tr>
        </thead>
        <tbody>
			<s:iterator value="#request.searchRsList" status="stat" id="sh">
				<tr class="tb-line" >
					<%-- <s:if test="op.roleType==\"12\" || op.roleType==\"13\" || op.roleType==\"03\" "> --%>
						<s:if test="op.roleType==\"12\" || op.roleType==\"13\"  ">
						<td class="tb-td" align="center">
							<input name="multi_sel" value="<s:property value="#sh.mid"/>" type="checkbox" />
						</td>
					</s:if>
					<td class="tb-td">
						<a href="javascript:isDetail(<s:property value="#sh.mid"/>)"><s:property value="#sh.mid"/></a>
					</td>
					<td class="tb-td"><s:property value="#sh.merName"/></td>
			        <td class="tb-td"><s:property value="#sh.merBrName"/></td>
			        <td class="tb-td">
			        	<s:iterator value="#sh.merCycle" var="c" status="aaa">
			        	  <s:property value="#c" />
			        	</s:iterator>
			        </td>
			       <td class="tb-td">
			       	 
			        	<s:if test="#sh.nationCd==\"0\"">个体户</s:if>
			        	<s:if test="#sh.nationCd==\"1\"">企业</s:if>
			        </td>
			        <td class="tb-td"><s:property value="#sh.merKind"/> </td>
			        <td class="tb-td">
	        				<s:if test="#sh.companyName ==null || #sh.companyName==''">暂无</s:if>
	        				<s:else><s:property value="#sh.companyName"/></s:else>
			         </td>
			         <%-- <td class="tb-td">
			         	<s:if test="#sh.oneAgentName ==null || #sh.oneAgentName==''">暂无</s:if>
	        			<s:else><s:property value="#sh.oneAgentName"/></s:else>
			         </td> --%>
			         <td class="tb-td">
			         	<s:if test="#sh.agentId ==null || #sh.agentId==''">暂无</s:if>
	        			<s:else><s:property value="#sh.agentId"/></s:else>
			         </td>
			        <td class="tb-td">
			        	<s:if test="#sh.bus_lic == \"\"">陈静
			        	</s:if>
			        	<s:else>
			        		<s:property value="#sh.bus_lic"/> 
			        	</s:else>
			        </td>
			        <td class="tb-td">
			        <s:property value="#sh.applDate"/> 
			        </td>
			        <td class="tb-td"><font id="s_<s:property value="#sh.mid"/>"><s:property value="#sh.flag"/></font></td>
			        <td class="tb-td"><s:property value="#sh.perName"/></td>
			        <td class="tb-td"><s:property value="#sh.perPhone"/></td>
			        <td class="tb-td"><s:property value="#sh.interContact"/></td>
			        <td class="tb-td"><s:property value="#sh.cardNo"/></td>
			        <s:if test="op.roleType==\"18\"||op.roleType==\"00\"||op.roleType==\"12\"||op.roleType==\"13\"||op.groupCd==\"2\" ">
				    <td class="tb-td"><s:property value="#sh.certifDate"/></td>
			        </s:if>
			        <td class="tb-td"><s:property value="#sh.amount1"/></td>
			        <td class="tb-td"><s:property value="#sh.amount2"/></td>
			        <td class="tb-td"><s:property value="#sh.rsvl"/></td>
			        <td class="tb-td"><s:property value="#sh.rsvl3"/></td>
			        <td class="tb-td"><s:property value="#sh.addr"/></td>
			        <td class="tb-td"><s:property value="#sh.flagCode"/></td>
			       <s:if test="op.roleType==\"18\"||op.roleType==\"00\"||op.roleType==\"12\"||op.roleType==\"13\"||op.groupCd==\"2\" ">
				     <td class="tb-td"><s:property value="#sh.busiLiceDate"/></td>
			        <td class="tb-td"><s:property value="#sh.termProperty"/></td>
			        <td class="tb-td"><s:property value="#sh.developPerson"/></td>
				    </s:if>
			      </tr>
			</s:iterator>		
        </tbody>
    </table>
   
</div>
 <s:if test="#request.msg !=null">
		<script language="javascript">
			alert("${request.msg}");
		</script>
	</s:if>
</body>
</html>